package com.factory.entity;

import java.util.Date;

public class Employee {
    private Integer empId;
    private String empName;
    private String gender;
    private Integer age;
    private String position;
    private String department;
    private Double salary;
    private Date hireDate;
    private String email;
    private String phone;
    private String address;
    private Date createTime;

    // 无参构造
    public Employee() {}

    // 带参构造
    public Employee(String empName, String gender, Integer age, String position,
                    String department, Double salary) {
        this.empName = empName;
        this.gender = gender;
        this.age = age;
        this.position = position;
        this.department = department;
        this.salary = salary;
        this.hireDate = new Date();
    }

    // Getter和Setter方法
    public Integer getEmpId() { return empId; }
    public void setEmpId(Integer empId) { this.empId = empId; }

    public String getEmpName() { return empName; }
    public void setEmpName(String empName) { this.empName = empName; }

    public String getGender() { return gender; }
    public void setGender(String gender) { this.gender = gender; }

    public Integer getAge() { return age; }
    public void setAge(Integer age) { this.age = age; }

    public String getPosition() { return position; }
    public void setPosition(String position) { this.position = position; }

    public String getDepartment() { return department; }
    public void setDepartment(String department) { this.department = department; }

    public Double getSalary() { return salary; }
    public void setSalary(Double salary) { this.salary = salary; }

    public Date getHireDate() { return hireDate; }
    public void setHireDate(Date hireDate) { this.hireDate = hireDate; }

    public String getEmail() { return email; }
    public void setEmail(String email) { this.email = email; }

    public String getPhone() { return phone; }
    public void setPhone(String phone) { this.phone = phone; }

    public String getAddress() { return address; }
    public void setAddress(String address) { this.address = address; }

    public Date getCreateTime() { return createTime; }
    public void setCreateTime(Date createTime) { this.createTime = createTime; }

    @Override
    public String toString() {
        return String.format("员工ID: %d, 姓名: %s, 职位: %s, 部门: %s, 薪资: %.2f",
                empId, empName, position, department, salary);
    }
}